package edu.buaa.act.travel.m.page;

import edu.buaa.act.travel.m.Constants;
import edu.buaa.act.travel.m.model.RunModel;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.DialogInterface.OnCancelListener;
import android.os.Bundle;

public class ConfirmActivity extends BaseActivity {
	
	private Dialog mMenuDialog;

	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        final RunModel model = (RunModel) getIntent().getSerializableExtra(Constants.EXTRA_RUN_MODEL);
        if(model != null) {
        	mMenuDialog = new AlertDialog.Builder(this).setTitle(model.getQueryText())
			.setItems(model.getQueryOptions(), new DialogInterface.OnClickListener() {
				
				@Override
				public void onClick(DialogInterface dialog, int which) {
					finish();
				}
			}).create();
        	mMenuDialog.setOnCancelListener(new OnCancelListener() {
				
				@Override
				public void onCancel(DialogInterface dialog) {
					finish();
				}
			});
        	mMenuDialog.show();
        }
	}
}
